package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.AttentionStateEnum;
import com.frogs.system.util.HdcAttentionListTypeEnum;
import com.frogs.system.util.HdcReceiveStateEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 关注列表参数
 *
 * @author wushubin
 */
public class UserAttentionListRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1925725392160982735L;
	
	private Integer followedUserId;
	
	private Integer followUserId;
	
	private Integer isReceiveAlert;
	
	private Integer type;
	
	private Integer pageSize;
	
	private Integer pageNum;
	
	private Integer openPlatformId;
	
	/** */
	public UserAttentionListRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.followedUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followedUserId.getParamName(),0);
		this.followUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followUserId.getParamName(), 0);
		this.isReceiveAlert = requestInfo.getIntParameter(ApiUrlParamEnum.isReceiveAlert.getParamName(), HdcReceiveStateEnum.RECEIVE_MESSAGE.getId());
		this.type = requestInfo.getIntParameter(ApiUrlParamEnum.type.getParamName(), HdcAttentionListTypeEnum.ATTENTION_FOLLOW_LIST.getId());
		this.pageSize = requestInfo.getIntParameter(ApiUrlParamEnum.pageSize.getParamName(), 20);
		this.pageNum = requestInfo.getIntParameter(ApiUrlParamEnum.pageNo.getParamName(), 1);
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), OpenPlatformEnum.WECHAT_HDC.getId());
		if (followUserId < 1 && followedUserId < 1) {
			throw new RequestIllegalException("error followUserId or followedUserId! ");
		}
		
	}

	public Integer getFollowedUserId() {
		return followedUserId;
	}

	public void setFollowedUserId(Integer followedUserId) {
		this.followedUserId = followedUserId;
	}

	public Integer getFollowUserId() {
		return followUserId;
	}

	public void setFollowUserId(Integer followUserId) {
		this.followUserId = followUserId;
	}

	public Integer getIsReceiveAlert() {
		return isReceiveAlert;
	}

	public void setIsReceiveAlert(Integer isReceiveAlert) {
		this.isReceiveAlert = isReceiveAlert;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Integer getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(Integer openPlatformId) {
		this.openPlatformId = openPlatformId;
	}
}
